<%var jstpl = {%>
    <script>
        var app = new Vue({
            el: "#gexin_body",
            data: {
                addr_query: {
                    id: '${user.id!}',
                    pageNumber: 1,
                    pageSize: 10,
                    type: 1
                },
                addr_result: [],
                integral_query: {
                    id: '${user.id!}',
                    pageNumber: 1,
                    pageSize: 10,
                    type: 2
                },
                integral_result: [],
                order_query: {
                    id: '${user.id!}',
                    pageNumber: 1,
                    pageSize: 10,
                    type: 3
                },
                order_result: [],
                tel_query: {
                    id: '${user.id!}',
                    pageNumber: 1,
                    pageSize: 10,
                    type: 4
                },
                tel_result: []
            },
            created: function() {},
            methods: {
                loadAddrData: function(model) { //加载收货地址
                    if (model == "init") {
                        this.addr_query.pageNumber = 1;
                    }
                    Ajax("/system/member/loadDetatilData", this.addr_query, function(d) {
                        if (!d.state) {
                            gx.alert(d.msg);
                            return false;
                        }
                        if (d.data.list == null || d.data.list.size <= 0 || d.data == null) {
                            app.addr_query.pageNumber = 1;
                            app.addr_result = [];
                            return false;
                        }
                        app.addr_result = d.data.list;
                        if (d.data.firstPage == true) {
                            layui.laypage.render({
                                elem: 'gexin_page_addr' //注意，这里的 test1 是 ID，不用加 # 号
                                    ,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                                count: d.data.totalRow //数据总数，从服务端得到
                                    ,
                                limit: app.addr_query.pageSize,
                                jump: function(obj, first) {
                                    app.addr_query.pageNumber = obj.curr;
                                    if (app.addr_query.pageSize != obj.limit) {
                                        app.addr_query.pageSize = obj.limit;
                                        app.loadAddrData("init");
                                        return;
                                    }
                                    if (!first) {
                                        app.loadAddrData("load");
                                    }
                                }
                            });
                        }
                    })
                },
                loadIntegralData: function(model) { //加载积分
                    if (model == "init") {
                        this.integral_query.pageNumber = 1;
                    }
                    Ajax("/system/member/loadDetatilData", this.integral_query, function(d) {
                        if (!d.state) {
                            gx.alert(d.msg);
                            return false;
                        }
                        if (d.data.list == null || d.data.list.size <= 0 || d.data == null) {
                            app.integral_query.pageNumber = 1;
                            app.integral_result = [];
                            return false;
                        }
                        app.integral_result = d.data.list;
                        if (d.data.firstPage == true) {
                            layui.laypage.render({
                                elem: 'gexin_page_integral' //注意，这里的 test1 是 ID，不用加 # 号
                                    ,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                                count: d.data.totalRow //数据总数，从服务端得到
                                    ,
                                limit: app.integral_query.pageSize,
                                jump: function(obj, first) {
                                    app.integral_query.pageNumber = obj.curr;
                                    if (app.integral_query.pageSize != obj.limit) {
                                        app.integral_query.pageSize = obj.limit;
                                        app.loadIntegralData("init");
                                        return;
                                    }
                                    if (!first) {
                                        app.loadIntegralData("load");
                                    }
                                }
                            });
                        }
                    })
                },
                loadOrderData: function(model) { // 加载订单
                    if (model == "init") {
                        this.order_query.pageNumber = 1;
                    }
                    Ajax("/system/member/loadDetatilData", this.order_query, function(d) {
                        if (!d.state) {
                            gx.alert(d.msg);
                            return false;
                        }
                        if (d.data.list == null || d.data.list.size <= 0 || d.data == null) {
                            app.order_query.pageNumber = 1;
                            app.order_result = [];
                            return false;
                        }
                        app.order_result = d.data.list;
                        if (d.data.firstPage == true) {
                            layui.laypage.render({
                                elem: 'gexin_page_order' //注意，这里的 test1 是 ID，不用加 # 号
                                    ,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                                count: d.data.totalRow //数据总数，从服务端得到
                                    ,
                                limit: app.order_query.pageSize,
                                jump: function(obj, first) {
                                    app.order_query.pageNumber = obj.curr;
                                    if (app.order_query.pageSize != obj.limit) {
                                        app.order_query.pageSize = obj.limit;
                                        app.loadOrderData("init");
                                        return;
                                    }
                                    if (!first) {
                                        app.loadOrderData("load");
                                    }
                                }
                            });
                        }
                    })
                },
                loadTelData: function(model) { // 加载联系记录
                    if (model == "init") {
                        this.tel_query.pageNumber = 1;
                    }
                    Ajax("/system/member/loadDetatilData", this.tel_query, function(d) {
                        if (!d.state) {
                            gx.alert(d.msg);
                            return false;
                        }
                        if (d.data.list == null || d.data.list.size <= 0 || d.data == null) {
                            app.tel_query.pageNumber = 1;
                            app.tel_result = [];
                            return false;
                        }
                        app.tel_result = d.data.list;
                        if (d.data.firstPage == true) {
                            layui.laypage.render({
                                elem: 'gexin_page_tel' //注意，这里的 test1 是 ID，不用加 # 号
                                    ,
                                layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                                count: d.data.totalRow //数据总数，从服务端得到
                                    ,
                                limit: app.tel_query.pageSize,
                                jump: function(obj, first) {
                                    app.tel_query.pageNumber = obj.curr;
                                    if (app.tel_query.pageSize != obj.limit) {
                                        app.tel_query.pageSize = obj.limit;
                                        app.loadTelData("init");
                                        return;
                                    }
                                    if (!first) {
                                        app.loadTelData("load");
                                    }
                                }
                            });
                        }
                    })
                }
            }
        })
    </script>
    <%};%>
        <%var csstpl = {%>
            <style type="text/css">
                [v-cloak] {
                    display: none
                }
            </style>
            <%};%>
                <%layout("../layout/_layout_layui.html",{title:'会员详情',jstpl:jstpl,csstpl:csstpl}){ %>
                    <section id="content">
                        <form class="layui-form  form-horizontal" role="form">
                            <div class="layui-row">
                                <div class="layui-tab layui-tab-card">
                                    <ul class="layui-tab-title">
                                        <li class="layui-this">基本资料</li>
                                        <li @click="loadAddrData('init')">收货地址</li>
                                        <li @click="loadIntegralData('init')">积分记录</li>
                                        <li @click="loadOrderData('init')">订单记录</li>
                                        <li @click="loadTelData('init')">联系记录</li>
                                    </ul>
                                    <div class="layui-tab-content" style="height: auto;">

                                        <!--基本资料 内容开始-->
                                        <div class="layui-tab-item layui-show">
                                            <div class="layui-col-md12">
                                                <div class="layui-card">
                                                    <div class="layui-card-body" pad15="">

                                                        <div class="layui-form" lay-filter="">

                                                            <div class="layui-form-item">
                                                                <label class="layui-form-label">微信昵称</label>
                                                                <div class="layui-input-inline">
                                                                    <input type="text" value="${user.nickname!}" readonly class="layui-input">
                                                                </div>
                                                            </div>

                                                            <div class="layui-form-item">
                                                                <label class="layui-form-label">登录账号</label>
                                                                <div class="layui-input-inline">
                                                                    <input type="text" value="${user.username!}" readonly class="layui-input">
                                                                </div>
                                                            </div>

                                                            <div class="layui-form-item">
                                                                <label class="layui-form-label">总积分</label>
                                                                <div class="layui-input-inline">
                                                                    <input type="text" value="${user.sum_integral!}" readonly class="layui-input">
                                                                </div>
                                                            </div>


                                                            <div class="layui-form-item">
                                                                <label class="layui-form-label">最新登录时间</label>
                                                                <div class="layui-input-inline">
                                                                    <input type="text" value="${user.uptime,'yyyy-MM-dd HH:mm:ss'}" readonly class="layui-input">
                                                                </div>
                                                            </div>

                                                        </div>

                                                    </div>
                                                </div>
                                            </div>

                                        </div>
                                        <!--基本资料 内容结束-->
                                        <!--收货地址 内容开始-->
                                        <div class="layui-tab-item">

                                            <div class="layui-col-md12" style="margin-top: 20px">
                                                <table class="layui-table">
                                                    <thead>
                                                        <tr>
                                                            <th>名称</th>
                                                            <th>性别</th>
                                                            <th>电话</th>
                                                            <th>地址</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody id="tbody_body">
                                                        <tr v-for="d  in  addr_result">
                                                            <td>{{d.consignee}}</td>
                                                            <td v-if="d.sex=='0'">未知</td>
                                                            <td v-else-if="d.sex=='1'">男</td>
                                                            <td v-else-if="d.sex=='2'">女</td>
                                                            <td v-else></td>
                                                            <td>{{d.phone}}</td>
                                                            <td>{{d.country}}&nbsp{{d.province}}&nbsp{{d.city}}&nbsp;{{d.address}}</td>
                                                        </tr>
                                                        <tr v-if="addr_result.length==0">
                                                            <td colspan="4" style="text-align:center;height:300px">
                                                                <h1>没有数据</h1>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <fieldset id="gexin_page_addr" class="layui-elem-field layui-field-title">
                                                </fieldset>
                                            </div>

                                        </div>
                                        <!--收货地址 内容结束-->
                                        <!--积分记录 内容开始-->
                                        <div class="layui-tab-item">

                                            <div class="layui-col-md12" style="margin-top: 20px">
                                                <table class="layui-table">
                                                    <thead>
                                                        <tr>
                                                            <th>积分类型</th>
                                                            <th>积分数量</th>
                                                            <th>积分来路</th>
                                                            <th>获取时间</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody id="tbody_body">
                                                        <tr v-for="d  in  integral_result">
                                                            <td>{{d.integral_type==1?'增加':'减少'}}</td>
                                                            <td>{{d.integral_quantity}}</td>
                                                            <td>{{d.integral_reason}}</td>
                                                            <td>{{d.create_time}}</td>
                                                        </tr>
                                                        <tr v-if="integral_result.length==0">
                                                            <td colspan="4" style="text-align:center;height:300px">
                                                                <h1>没有数据</h1>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <fieldset id="gexin_page_integral" class="layui-elem-field layui-field-title">
                                                </fieldset>
                                            </div>

                                        </div>
                                        <!--积分记录 内容结束-->
                                        <!--订单记录 内容开始-->
                                        <div class="layui-tab-item">

                                            <div class="layui-col-md12" style="margin-top: 20px">
                                                <table class="layui-table">
                                                    <thead>
                                                        <tr>
                                                            <th>订单编号</th>
                                                            <th>订单金额</th>
                                                            <th>支付金额</th>
                                                            <th>订单状态</th>
                                                            <th>下单时间</th>
                                                        </tr>
                                                    </thead>
                                                    <tbody id="tbody_body">
                                                        <tr v-for="d  in  order_result">
                                                            <td>{{d.id}}</td>
                                                            <td>{{d.total_amount}}</td>
                                                            <td>{{d.total_amount}}</td>
                                                            <td>{{d.state_name}}</td>
                                                            <td>{{d.createtime}}</td>
                                                        </tr>
                                                        <tr v-if="order_result.length==0">
                                                            <td colspan="5" style="text-align:center;height:300px">
                                                                <h1>没有数据</h1>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                                <fieldset id="gexin_page_order" class="layui-elem-field layui-field-title">
                                                </fieldset>
                                            </div>

                                        </div>
                                        <!--订单记录 内容结束-->
                                        <!--联系记录 内容开始-->
                                        <div class="layui-tab-item">
                                        </div>
                                        <!--联系记录 内容结束-->
                                    </div>
                                </div>
                            </div>
                        </form>
                    </section>
                    <%};%>